<%--
  Created by IntelliJ IDEA.
  User: l
  Date: 2022/5/13
  Time: 22:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="menu.jsp"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="C" uri="http://java.sun.com/jsp/jstl/core" %>
<script src="js/function1.js"></script>
<script src="../shangc/js/jquery-1.12.4.min.js"></script>
<style>
    .error{
        display:  inline-block;
        color: red;
        font-size: 15px;
        margin-left: 10px;
    }
</style>
<!--/sidebar-->
<div class="main-wrap">

    <div class="crumb-wrap">
        <div class="crumb-list"><i class="icon-font"></i><a href="admin_index.jsp">首页</a><span class="crumb-step">&gt;</span><a class="crumb-name" href="admin_productselect">图书管理</a><span class="crumb-step">&gt;</span><span>修改图书</span></div>
    </div>
    <div class="result-wrap">
        <div class="result-content">
            <form action="/lyq/admin/admin_doproductupdate" onsubmit="return checkForm(this)" method="post" id="myform" enctype="multipart/form-data" name="myform">
                <table class="insert-tab" width="100%">
                    <input type="hidden" name="p_id" value="${p.product_id}">
                    <input type="hidden" name="file" value="${p.product_filename}">
                    <input type="hidden" name="cpage" value="${cp}">
                    <input type="hidden" name="keywords" value="${keywords}">
                    <tbody>
                    <tr>
                        <th><i class="require-red">*</i>图书名称：</th>
                        <td><input class="common-text" name="productname" onfocus="FocusItem(this)" onblur="CheckItem(this)" value="${p.product_name}" size="50" type="text"><span></span></td>
                    </tr>
                    <tr>
                        <th><i class="require-red">*</i>图书分类：</th>
                        <td>
                            <select class="common-text required"  name="parentid" >
                                <c:forEach items="${flist}" var="f">
                                    <option value="f.cate_id" disabled="disabled">-|${f.cate_name}</option>
                                    <c:forEach var="c" items="${clist}">
                                        <C:if test="${c.cate_parent_id == f.cate_id}">
                                            <c:if test="${f.cate_id == p.product_fid && c.cate_id == p.product_cid }">
                                                <option value="${f.cate_id}-${c.cate_id}" selected="selected">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${c.cate_name}</option>
                                            </c:if>
                                            <c:if test="${f.cate_id != p.product_fid || c.cate_id != p.product_cid }">
                                                <option value="${f.cate_id}-${c.cate_id}">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${c.cate_name}</option>
                                            </c:if>
                                        </C:if>
                                    </c:forEach>
                                </c:forEach>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th><i class="require-red">*</i>图书图片：</th>
                        <td><input style="color: #1A1A1A" name="photo" size="50" type="file" value="${p.product_filename}"><span></span>
                        <img src="../shangc/image/product/${p.product_filename}" onfocus="FocusItem(this)" onblur="CheckItem(this)" height="50" width="43" height="43"></td>
                    </tr>
                    <tr>
                        <th><i class="require-red">*</i>图书价格：</th>
                        <td><input class="common-text" value="${p.product_price}" onfocus="FocusItem(this)" onblur="CheckItem(this)" name="productprice" size="50" type="text"><span></span></td>
                    </tr>
                    <tr>
                        <th><i class="require-red">*</i>图书介绍：</th>
                        <td><input class="common-text" name="productDesc" onfocus="FocusItem(this)" onblur="CheckItem(this)" value="${p.product_description}" size="50" type="text"><span></span></td>
                    </tr>
                    <tr>
                        <th><i class="require-red">*</i>图书库存：</th>
                        <td><input class="common-text" name="productstock" onfocus="FocusItem(this)" onblur="CheckItem(this)" value="${p.product_stock}" size="50" type="text"><span></span></td>
                    </tr>
                    <tr>
                        <th></th>
                        <td>
                            <input class="btn btn-primary btn6 mr10" value="提交" type="submit">
                            <input class="btn btn6" onClick="history.go(-1)" value="返回" type="button">
                        </td>
                    </tr>
                    </tbody></table>
            </form>
        </div>
    </div>

</div>
<!--/main-->
</div>
</body>
</html>